package com.ruoyi.estate.domain;

import com.fasterxml.jackson.annotation.JsonInclude;
import com.ruoyi.common.core.domain.TreeSelect;
import com.ruoyi.common.core.domain.entity.SysDept;
import com.ruoyi.common.core.domain.entity.SysMenu;

import java.io.Serializable;
import java.util.ArrayList;
import java.util.List;
import java.util.stream.Collectors;

public class FloorTreeSelect implements Serializable {
    private static final long serialVersionUID = 1L;

    /** 节点ID */
    private Long id;

    /** 节点名称 */
    private String label;

    /** 节点层级 */
    private Integer level;

    /** 子节点 */
    @JsonInclude(JsonInclude.Include.NON_EMPTY)
    private List<FloorTreeSelect> children=new ArrayList<>();

    public FloorTreeSelect()
    {

    }

    public FloorTreeSelect(BusinessFloor floor)
    {
        this.id = floor.getFloorId();
        this.label = floor.getName();
        this.level=1;
    }

    public FloorTreeSelect(BuildingUnit unit) {
        this.id=unit.getUnitId();
        this.label=unit.getName();
        this.level=2;
    }

    public Integer getLevel() {
        return level;
    }

    public void setLevel(Integer level) {
        this.level = level;
    }

    public Long getId()
    {
        return id;
    }

    public void setId(Long id)
    {
        this.id = id;
    }

    public String getLabel()
    {
        return label;
    }

    public void setLabel(String label)
    {
        this.label = label;
    }

    public List<FloorTreeSelect> getChildren()
    {
        return children;
    }

    public void setChildren(List<FloorTreeSelect> children)
    {
        this.children = children;
    }
}
